package com.xh3140.xwidget.app;

import android.content.Intent;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.xh3140.xwidget.app.button.ButtonActivity;
import com.xh3140.xwidget.app.button.ButtonGroupActivity;
import com.xh3140.xwidget.app.databinding.ActivityMainBinding;
import com.xh3140.xwidget.app.dialog.DialogActivity;
import com.xh3140.xwidget.app.toolbar.ToolbarActivity;

public class MainActivity extends AppCompatActivity {
  private ActivityMainBinding binding;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
    initListener();
  }

  private void initListener() {
    binding.btnButton.setOnClickListener(v -> startActivity(new Intent(this, ButtonActivity.class)));
    binding.btnButtonGroup.setOnClickListener(v -> startActivity(new Intent(this, ButtonGroupActivity.class)));
    binding.btnDialog.setOnClickListener(v -> startActivity(new Intent(this, DialogActivity.class)));
    binding.btnToolbar.setOnClickListener(v -> startActivity(new Intent(this, ToolbarActivity.class)));
  }
}